/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0 20px 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    color: #4a5568;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 i {
    color: #667eea;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    text-decoration: none;
    color: #718096;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(113, 128, 150, 0.1);
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

.nav-link.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 主要内容区域 */
.main {
    margin-bottom: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-header h2 {
    color: white;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h2, .card-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-content {
    padding: 30px;
}

/* 按钮样式 */
.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* 过滤表单样式 */
.filter-form {
    padding: 20px 0;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.filter-group input {
    padding: 12px 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.filter-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

/* 搜索框样式 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 12px 40px 12px 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    min-width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box i {
    position: absolute;
    right: 15px;
    color: #718096;
}

/* 自动刷新样式 */
.auto-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
}

.auto-refresh input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-info p {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.data-table th:first-child {
    border-radius: 15px 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 15px 0 0;
}

.data-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    vertical-align: middle;
}

.time-cell {
    white-space: nowrap;
    font-size: 12px;
    color: #718096;
}

.traffic-cell {
    white-space: nowrap;
    font-family: monospace;
    font-size: 13px;
    font-weight: 500;
}

.traffic-cell.download {
    color: #48bb78;
}

.traffic-cell.upload {
    color: #ed8936;
}

.duration-cell {
    white-space: nowrap;
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.ip-address {
    font-family: monospace;
    font-size: 12px;
    color: #4a5568;
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
}

.data-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loading i {
    font-size: 24px;
    color: #667eea;
}

/* 用户列表样式 */
.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.user-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.user-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.user-info h4 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.user-info p {
    color: #718096;
    font-size: 12px;
}

.user-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #718096;
    font-size: 12px;
    font-weight: 500;
}

.stat-value {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

/* 流量统计样式 */
.traffic-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.traffic-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.traffic-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.traffic-icon.download {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.traffic-icon.upload {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.traffic-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.traffic-info h4 {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.traffic-info p {
    color: #718096;
    font-size: 12px;
    font-weight: 500;
}

/* 历史统计样式 */
.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* 用户统计样式 */
.user-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.stat-card .stat-info h4 {
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-card .stat-info p {
    color: #718096;
    font-size: 12px;
    font-weight: 500;
}

/* 计数显示 */
.user-count, .record-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-actions {
        justify-content: center;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .filter-actions {
        justify-content: center;
    }
    
    .search-box input {
        min-width: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .traffic-stats {
        grid-template-columns: 1fr;
    }
    
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .users-list {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .card-header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .page-header h2 {
        font-size: 24px;
    }
} 